home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / BUS / TMCM Software and Labs.sit / Software for TMCM 7_95 / Files for Lab 13 / Sum Of Squares < prev    next >
Text File  |  1995-07-07  |  214b  |  12 lines

  1. DECLARE sum
  2.  
  3. SUB SumOfSquares(top)
  4.    import sum
  5.    sum := 0
  6.    fork(top)
  7.    sum := sum + ForkNumber^2
  8. END SUB
  9.  
  10. SumOfSquares(10)
  11. TellUser("The sum of the squares of the first 10 integers was computed to be #sum.")
  12.